<template>
  <div class="button-select">
    <y-button v-for="item in options" :key="item.value" :type="value === item.value ? 'primary' : 'default'" @click="handleClick(item.value)">
      {{ item.label }}
    </y-button>
  </div>
</template>

<script>
 /**
  *Parser 基于y-button的选择器
  *@Author
  *@Version
  *@property
  *@event
*/
export default {
  props: {
    value: {
        type: String,
        default: ''
    },
    options: {
        type: Array,
        default: () => {}
    }
  },
  data () {
    return {
    }
  },
  methods: {
    handleClick (value) {
        this.$emit('input', value)
        this.$emit('change', value)
    }
  }
}

</script>
<style lang="less" scoped>
.button-select{
  display: inline-block;
}
</style>
